package it.xiuxian.login.activity

import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.zzhoujay.richtext.RichText
import it.xiuxian.lib.base.ArouterAddress
import it.xiuxian.lib.base.BaseActivity
import it.xiuxian.lib.bean.ContentBean
import it.xiuxian.login.R
import it.xiuxian.login.databinding.ActivityUseragreementBinding
import it.xiuxian.login.presenter.UserAgreementActivityPresenter
@Route(path = ArouterAddress.USERAGREEMENTACTIVITY)
class UserAgreementActivity:BaseActivity<UserAgreementActivityPresenter>() {
    @JvmField
    @Autowired
    var key:String?=null
    var binding:ActivityUseragreementBinding?=null
    override val layoutId: Int
        get() = R.layout.activity_useragreement
    override val presenter: UserAgreementActivityPresenter
        get() = UserAgreementActivityPresenter()

    override fun initView() {
        ARouter.getInstance().inject(this)
       binding = getViewDataBinding<ActivityUseragreementBinding>()
        if(key=="1"){
            setTitle("用户协议")
        }else {
            setTitle("隐私协议")
        }
        mPresenter!!.aboutUs()
    }

    fun setUI(data: ContentBean) {
        if(key=="1"){
            RichText.from(data.yonghuxieyi).into(binding!!.tvAg)
        }else{
            RichText.from(data.yinsixieyi).into(binding!!.tvAg)
        }


    }
}